package map;

import java.text.Collator;
import java.util.Locale;
import java.util.TreeMap;

public class Test {
    public static void main(String[] args) {
        TreeMap<Student, String> map = new TreeMap<>();
        map.put(new Student("张三"),"背带裤");
        map.put(new Student("李四"),"🏀");
        map.put(new Student("王五"),"🐓");
        System.out.println(map);
    }
}
class Student implements Comparable<Student>{
    private String name;

    public Student() {
    }

    public Student(String name) {
        this.name = name;
    }

    @Override
    public int compareTo(Student o) {
        return Collator.getInstance(Locale.CHINA).compare(name, o.name);

    }

    /**
     * 获取
     * @return name
     */
    public String getName() {
        return name;
    }

    /**
     * 设置
     * @param name
     */
    public void setName(String name) {
        this.name = name;
    }

    public String toString() {
        return "Student{name = " + name + "}";
    }
}
